package com.springboot.project.controller;

import com.springboot.project.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/excel")
public class ExcelController {

    @Autowired
    private ExcelService excelService;

    /**
     * @return
     */
    @PostMapping("/parse")
    public Object parse(@RequestParam("file") MultipartFile file, @RequestParam("regionId") Integer regionId,@RequestParam("val") String val) {

        return excelService.readExcelFile(file,regionId,val);
    }
}
